// 模拟音乐数据
const mockData = {
  // 热门歌曲列表 - 使用可用的音频源
  hotSongs: [
    {
      id: 1,
      name: "夜曲",
      artist: "周杰伦",
      cover: "https://ai-public.mastergo.com/ai/img_res/84852331d737a84a93580d27d0607c9b.jpg",
      url: "https://music.163.com/song/media/outer/url?id=186175.mp3",
      duration: 270,
      album: "十一月的萧邦"
    },
    {
      id: 2,
      name: "青花瓷",
      artist: "周杰伦",
      cover: "https://ai-public.mastergo.com/ai/img_res/f202af1da58db605899207f0ca21da92.jpg",
      url: "https://music.163.com/song/media/outer/url?id=186175.mp3",
      duration: 240,
      album: "我很忙"
    },
    {
      id: 3,
      name: "夜的钢琴曲",
      artist: "石进",
      cover: "https://ai-public.mastergo.com/ai/img_res/c60843ac95e00f33936365c7137143c3.jpg",
      url: "https://music.163.com/song/media/outer/url?id=186175.mp3",
      duration: 180,
      album: "夜的钢琴曲"
    },
    {
      id: 4,
      name: "南山南",
      artist: "马頔",
      cover: "https://ai-public.mastergo.com/ai/img_res/25afeda50ad3dac72efd6dc881681610.jpg",
      url: "https://music.163.com/song/media/outer/url?id=186175.mp3",
      duration: 210,
      album: "孤岛"
    },
    {
      id: 5,
      name: "成都",
      artist: "赵雷",
      cover: "https://ai-public.mastergo.com/ai/img_res/4e1f977299b442511e6e528f562a0604.jpg",
      url: "https://music.163.com/song/media/outer/url?id=186175.mp3",
      duration: 300,
      album: "无法长大"
    }
  ],

  // 推荐歌单
  playlists: [
    {
      id: 1,
      name: "华语流行精选",
      cover: "https://ai-public.mastergo.com/ai/img_res/4e1f977299b442511e6e528f562a0604.jpg",
      songCount: 30,
      creator: "音乐推荐"
    },
    {
      id: 2,
      name: "摇滚经典回顾",
      cover: "https://ai-public.mastergo.com/ai/img_res/21cc2fddc552a414e8a15647d1c95caf.jpg",
      songCount: 25,
      creator: "经典音乐"
    },
    {
      id: 3,
      name: "轻音乐放松",
      cover: "https://ai-public.mastergo.com/ai/img_res/632dd2f0a7195545e852beb116028879.jpg",
      songCount: 20,
      creator: "放松时刻"
    },
    {
      id: 4,
      name: "90后回忆杀",
      cover: "https://ai-public.mastergo.com/ai/img_res/f202af1da58db605899207f0ca21da92.jpg",
      songCount: 35,
      creator: "怀旧金曲"
    }
  ],

  // 搜索建议
  searchSuggestions: [
    "周杰伦", "林俊杰", "邓紫棋", "薛之谦", "毛不易",
    "流行", "摇滚", "民谣", "轻音乐", "古典"
  ],

  // 用户信息
  userInfo: {
    avatar: "https://ai-public.mastergo.com/ai/img_res/632dd2f0a7195545e852beb116028879.jpg",
    nickname: "Alex Morgan",
    bio: "音乐爱好者",
    stats: {
      favorites: 128,
      plays: 356,
      following: 24
    }
  },

  // 播放历史
  playHistory: [
    {
      id: 2,
      name: "青花瓷",
      artist: "周杰伦",
      cover: "https://ai-public.mastergo.com/ai/img_res/f202af1da58db605899207f0ca21da92.jpg",
      playTime: "昨天"
    },
    {
      id: 3,
      name: "夜的钢琴曲",
      artist: "石进",
      cover: "https://ai-public.mastergo.com/ai/img_res/c60843ac95e00f33936365c7137143c3.jpg",
      playTime: "前天"
    },
    {
      id: 4,
      name: "南山南",
      artist: "马頔",
      cover: "https://ai-public.mastergo.com/ai/img_res/25afeda50ad3dac72efd6dc881681610.jpg",
      playTime: "3天前"
    }
  ],

  // 收藏列表
  favorites: [
    {
      id: 1,
      name: "夜曲",
      artist: "周杰伦",
      cover: "https://ai-public.mastergo.com/ai/img_res/84852331d737a84a93580d27d0607c9b.jpg",
      addTime: "2024-01-15"
    },
    {
      id: 5,
      name: "成都",
      artist: "赵雷",
      cover: "https://ai-public.mastergo.com/ai/img_res/4e1f977299b442511e6e528f562a0604.jpg",
      addTime: "2024-01-10"
    }
  ]
};

// 搜索功能
function searchSongs(keyword) {
  return mockData.hotSongs.filter(song => 
    song.name.includes(keyword) || song.artist.includes(keyword)
  );
}

// 获取歌单详情
function getPlaylistDetail(playlistId) {
  const playlist = mockData.playlists.find(p => p.id === playlistId);
  if (playlist) {
    return {
      ...playlist,
      songs: mockData.hotSongs.slice(0, 10) // 模拟歌单歌曲
    };
  }
  return null;
}

module.exports = {
  mockData,
  searchSongs,
  getPlaylistDetail
};